Introducing the New SproutCore Blog

written by admin

If you follow the links in one of our blog posts today you may find the blog looks a bit different. And by different I mean generic.  What’s going on?

In preparation for SproutCore 1.0, we’re planning to launch a new website.  Part of our site redesign involves switching to the Tumblr blogging platform from Wordpress.

We want the SproutCore Blog to be the go-to source for discovering what’s happening in the world of SproutCore.  Tumblr makes that easy by offers tools to easily link to other resources around the web in a “tumblog” format.

Even though the site redesign is not yet complete, as we gear up for the new SproutCore 1.0 launch, we wanted to go ahead and get started using the new Tumblr features to document some of our progress.  In the mean time, the main site will remain up while the blog itself will soon redirect to this new site.  If you are reading the blog through a feed, you should automatically switch to receiving new posts from this blog instead.

Happy tumbling.

-Charles

Introducing SC.Freezable and SC.Copyable

written by admin

Link: Introducing SC.Freezable and SC.Copyable

Following up on my earlier post about adopting ES5 conventions.  One of the API changes we recently made to SproutCore 1.0 was the introduction of the SC.Freezable and SC.Copyable mixins (linked to this post).

SC.Freezable adds a freeze() method to objects that use it.  In ES5 engines, this will actually freeze the object so that further modifications raise an exception.  Today, it simply sets the isFrozen property to YES.  Mutating methods can then be implemented to throw an exception if they are called while the object isFrozen.

Freezing is most useful in conjunction with the SC.Copyable mixin.  This mixin defines some standard methods for copying an object.  copy() returns a clone of the object.  frozenCopy() returns a clone of the object that has been frozen.  If you call frozenCopy() of an object that is already frozen, the method simply returns itself.

This pattern is great because now if you want to modify an object, you can get a copy by calling copy().  Even if the object is frozen, you’ll get a new object that is not frozen.  Likewise, if you want to keep a copy of the object around for later use and you want to be sure it won’t change, you can use frozenCopy().  If the object you are working on is already frozen, this won’t allocate more memory and slow your program down, so its really efficient.

One of the big reasons ES5 introduces the concept of freezing is to make it easier to work with objects as a kind of primitive type.  For example, a Range - with an start and a length value - should often be treated like a primitive value like a number; once it is created it can never be changed.  Freezing makes this possible.

By using SC.Freezable, copy(), frozenCopy() you can take advantage of this new capability in ES5 in your SproutCore applications today simply by following this simple protocol.

Analyst: ‘Dramatically’ different Apple tablet in 2010 - Apple 2.0

written by admin

Link: Analyst: ‘Dramatically’ different Apple tablet in 2010 - Apple 2.0

Of course I have no idea if this is true, but I do think that the tablet/netbook category is destined to be huge.  Most consumers who buy cheap PCs for the home do so for web browsing and email (most of which is also done through the web browser).

Web tablets have the potential to be both cheaper and more portable than a low end PC, so why would you get something else?

I predict one day web tablets will be like TVs - most households will have several.  TVs themselves will essentially become large web tablets.

Web apps, of course, will drive this demand.  And those web apps needs to be very rich.  This is why I started Sproutit in the first place.